package carsharing;

public class Member {
	
	private int id;
	private int carriedBy;
	private Coordinates source, destination;
	private boolean isDriver, isCarried;

	public boolean isCarried() {
		return isCarried;
	}

	public void setCarried(boolean isCarried) {
		this.isCarried = isCarried;
	}

	public Member(int id) {
		this.id = id;
		this.isDriver = false;
	}
	
	public Member(int id, Coordinates source, Coordinates destination) {
		carriedBy = -1;
		this.id = id;
		this.source = source;
		this.destination = destination;
		this.isDriver = false;
		this.isCarried = false;
	}

	public Member copy() {
		Member aux = new Member(this.id, this.source, this.destination);
		aux.carriedBy = this.carriedBy;
		aux.isCarried = this.isCarried;
		aux.isDriver = this.isDriver;
		return aux;
	}
	
	public int getCarriedBy() {
		return carriedBy;
	}

	public void setCarriedBy(int carriedBy) {
		this.carriedBy = carriedBy;
	}

	public boolean isDriver() {
		return isDriver;
	}

	public void setDriver(boolean isDriver) {
		this.isDriver = isDriver;
	}

	public Coordinates getSource() {
		return source;
	}

	public void setSource(Coordinates source) {
		this.source = source;
	}

	public Coordinates getDestination() {
		return destination;
	}

	public void setDestination(Coordinates destination) {
		this.destination = destination;
	}

	public int getId() {
		return id;
	}
	
	public void print() {
		System.out.print("id ");
		System.out.print(id);
		System.out.print("|source ");
		source.print();
		System.out.print("|destination ");
		destination.print();
		System.out.print("|driver ");
		System.out.print(isDriver);
		System.out.print("|isCarried ");
		System.out.print(isCarried);
		System.out.print("|CarriedBy ");
		System.out.print(carriedBy);
	}

}
